package wyf.ytl;

import java.io.IOException;
import java.util.HashMap;

import org.xmlpull.v1.XmlPullParserException;

import android.app.Activity;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.widget.*;

public class Sample_2_8 extends Activity implements OnClickListener {
	Button dualButton, studyButton, optionButton;
	MediaPlayer mPlayer;
	GameView gameview;
	String currentLayout;

	public void initSound() {
		mPlayer = MediaPlayer.create(this, R.raw.bgsound01);

	}

	public void onCreate(Bundle savedInstanceState) {

		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		currentLayout = "main";

		initSound();
		// mPlayer.start();
		dualButton = (Button) this.findViewById(R.id.dualButton);
		studyButton = (Button) this.findViewById(R.id.studyButton);
		optionButton = (Button) this.findViewById(R.id.optionButton);

		dualButton.setOnClickListener(this);
		studyButton.setOnClickListener(this);
		optionButton.setOnClickListener(this);
		// dualButton.setBackgroundResource(R.drawable.buttonbackground);

	}



	public void onClick(View v) {
		if (v == dualButton) {
			setContentView(R.layout.game);
			currentLayout = "game";
		}
		if (v == studyButton) {
			setContentView(R.layout.game);
		}
		if (v == optionButton) {
		}

	}
}